package my.code.charpter5;

public class TagAction {
	int from;
	int to;
	int water;
	
	public TagAction(int from, int to, int water) {
		this.from = from;
		this.to = to;
		this.water = water;
	}

	public int getFrom() {
		return from;
	}

	public void setFrom(int from) {
		this.from = from;
	}

	public int getTo() {
		return to;
	}

	public void setTo(int to) {
		this.to = to;
	}

	public int getWater() {
		return water;
	}

	public void setWater(int water) {
		this.water = water;
	}
	
	@Override
	public String toString() {
		String[] dumpWater = new String[]{" 0", " 0", " 0"};
		dumpWater[from] = "-" + water;
		dumpWater[to] = "+" + water;
		
		StringBuilder sb = new StringBuilder();
		sb.append("{");
		sb.append(dumpWater[0]).append(",").append(dumpWater[1]).append(",").append(dumpWater[2]);
		sb.append("}");
		return sb.toString();
	}

}
